home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / PopUp / c / Show
Text File  |  1995-07-08  |  2KB  |  60 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    PopUp.Show.c
  12.     Author:  Copyright © 1993 Jason Williams
  13.     Version: 1.00 (20 May 1993)
  14.     Purpose: High(er)-level support for opening PopUps
  15. */
  16.  
  17.  
  18. #include <string.h>
  19.  
  20. #include "DeskLib:WimpSWIs.h"
  21. #include "DeskLib:PopUp.h"
  22.  
  23. static popup_handle DoShow(popup_block *block, char *name,
  24.                            popup_data *definition)
  25. {
  26.   strcpy(block->header.name, name);
  27.   memcpy(&block->data, definition, sizeof(popup_data));
  28.   block->header.reserved1 = block->header.reserved2 =
  29.                             block->header.reserved3 = 0;
  30.   return(PopUp_Open(block));
  31. }
  32.  
  33.  
  34. extern popup_handle PopUp_ShowPtr(char *name, BOOL isstatic,
  35.                                   popup_data *definition)
  36. {
  37.   popup_block temp;
  38.   mouse_block ptr;
  39.  
  40.   Wimp_GetPointerInfo(&ptr);
  41.   temp.header.openpos.x = ptr.pos.x - 64;
  42.   temp.header.openpos.y = ptr.pos.y + 64;
  43.   if (isstatic)
  44.     temp.header.flags = popup_STATIC;
  45.   else
  46.     temp.header.flags = popup_STANDALONE;
  47.   return(DoShow(&temp, name, definition));
  48. }
  49.  
  50.  
  51. extern popup_handle PopUp_ShowMenuLeaf(char *name, popup_data *definition,
  52.                                        message_menuwarn *msg)
  53. {
  54.   popup_block temp;
  55.  
  56.   temp.header.openpos = msg->openpos;
  57.   temp.header.flags = popup_MENULEAF;
  58.   return(DoShow(&temp, name, definition));
  59. }
  60.